Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix slew rate limiter drift when stopping #16

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

S1ink
Copy link

@S1ink S1ink commented Dec 30, 2023

My team was observing strange drifting behavior having to do with the slew rate limiter when coasting to a stop. The issue is that when a 0-velocity target is added to the slew rate limiter, a default angle of 0-degrees is assumed which results in the direction of travel getting smoothed across a range of angles from whatever initial angle existed back to 0 degrees - creating a curved trajectory.

The video shows a simulation of a non rate-limited swerve target, the current rate limiting implementation (yellow) and my new implementation (green).

2023-12-23.20-46-52.mp4

Finally, it should be noted that the slew rate constants now have physical units (acceleration) but I have not renamed them - this can be changed if deemed necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant